INSTALL_DIR=/usr/local
CFLAGS=-Wall -O2
LIBS=-lmsgserv
CC=gcc $(CFLAGS) $(LIBS)
obj=msglcd
msglcd-o=msglcd.o lcd.o

all: $(obj)

$(obj): $(obj).c
	for i in $($@-o); do make $$i; done
	$(CC) $(CFLAGS) $($@-o) -o $@
	
%.o: %.c %.h
	$(CC) $(CFLAGS) -c $< -o $@

install:
	install $(obj) $(INSTALL_DIR)/bin

uninstall:
	cd $(INSTALL_DIR)/bin && rm -f $(obj)

clean:
	rm -f *.o || true

distclean: clean
	rm $(obj) || true
	
